package com.sznaner.tool.util;

import android.content.ContentResolver;
import android.provider.Settings;

public class DBSystemUtil {

    public static ContentResolver getContentResolver(){
        return NRTool.context().getContentResolver();
    }
    //只存简单数据,不要存大数据
    public static Boolean putString(String key,String value){
        if(key == null || value == null) return false;
        return Settings.System.putString(getContentResolver(), key,value);
    }

    public static String getString(String key){
        return Settings.System.getString(getContentResolver(), key);
    }
    public static String getString(String key,String defValue){
        String value = defValue;
        String db_value = Settings.System.getString(getContentResolver(), key);
        if(db_value != null){
            value = db_value;
        }
        return value;
    }


}
